<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>模糊性评分 | Elasticsearch: 权威指南 | Elastic</title>
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
</head>
<body>
<div class="main-container">
    <section id="content">
        
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原文地址: <a href="https://www.elastic.co/guide/cn/elasticsearch/guide/current/fuzzy-scoring.html" rel="nofollow">https://www.elastic.co/guide/cn/elasticsearch/guide/current/fuzzy-scoring.html</a>, 版权归 www.elastic.co 所有<br/>
                            英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/fuzzy-scoring.html" rel="nofollow">https://www.elastic.co/guide/en/elasticsearch/guide/current/fuzzy-scoring.html</a>
                            </div>
                        <!-- start body -->
                  <div class="page_header">
<b>请注意:</b><br>本书基于 Elasticsearch 2.x 版本，有些内容可能已经过时。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch: 权威指南</a></span>
»
<span class="breadcrumb-link"><a href="languages.html">处理人类语言</a></span>
»
<span class="breadcrumb-link"><a href="fuzzy-matching.html">拼写错误</a></span>
»
<span class="breadcrumb-node">模糊性评分</span>
</div>
<div class="navheader">
<span class="prev">
<a href="fuzzy-match-query.html">« 模糊匹配查询</a>
</span>
<span class="next">
<a href="phonetic-matching.html">语音匹配 »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="fuzzy-scoring"></a>模糊性评分<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/edit/cn/270_Fuzzy_matching/50_Scoring_fuzziness.asciidoc">edit</a>
</h2>
</div></div></div>
<p>用户喜欢模糊查询。他们认为这种查询会魔法般的找到正确拼写组合。

很遗憾，实际效果平平。</p>
<p>假设我们有1000个文档包含 ``Schwarzenegger`` ，只是一个文档中错误的拼写成了 ``Schwarzeneger`` 。
根据 <a class="xref" href="scoring-theory.html#tfidf" title="词频/逆向文档频率（TF/IDF）">词频/逆向文档频率（TF/IDF）</a> 理论，这个拼写错误的文档的相关度比拼写正确的更高，因为错误拼写出现在更少的文档中！</p>
<p>换句话说，如果我们对待模糊匹配类似其他匹配方法，我们将偏爱错误的拼写超过了正确的拼写，这会让用户抓狂。</p>
<div class="tip admon">
<div class="icon"></div>
<div class="admon_content">
<p>模糊匹配不应被用于评分 —​ 只能在有拼写错误时扩大匹配项的范围。</p>
</div>
</div>
<p>默认情况下， <code class="literal">match</code> 查询给定所有的模糊匹配的固定评分为1。这可以满足在结果列表的末尾添加潜在的匹配记录，并且没有干扰非模糊查询的相关性评分。</p>
<div class="tip admon">
<div class="icon"></div>
<div class="admon_content">
<p>模糊查询刚开始出现时很少能单独使用。而更多是作为一个 ``bigger<code class="remark">(扩大搜索范围)</code>`` 场景的部分功能特性，如 <em>search-as-you-type (输入即搜索)</em>
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-suggesters-completion.html" class="ulink" target="_top"><code class="literal">自动完成</code>建议</a>或
<em>did-you-mean (你是不是想搜..)</em> <a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-suggesters-phrase.html" class="ulink" target="_top"><code class="literal">短语</code> 建议</a>。</p>
</div>
</div>
</div>
<div class="navfooter">
<span class="prev">
<a href="fuzzy-match-query.html">« 模糊匹配查询</a>
</span>
<span class="next">
<a href="phonetic-matching.html">语音匹配 »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>